<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3-16 mixins</title>
</head>
<body>

</body>
<script src="./js/vue.js"></script>
<script>
    //注意:
    //一、mixin中的数据data会被使用者覆盖
    //二、mixin中的钩子函数会先于使用之被调用
    var myMixin={
        created(){
            console.log(this)
            this.hello()
        },
        methods:{
            hello(){
                console.log("hello mixins")
            }
        }
    }
    var test_Component=Vue.extend({
        mixins:[myMixin]
    })
    var test=new test_Component()
</script>
</html>